package controllers;

import connectivity.Dbmanager;
import connectivity.QueryManager;
import java.io.*;
import java.util.LinkedList;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.swing.JOptionPane;
import models.User;
import models.Vraag;
import tools.Encryptor;

public class BrowseDocumentsController extends HttpServlet {

    private Dbmanager dbManager;
    private QueryManager queryManager;
    HttpSession sessie;

    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {
        sessie = request.getSession();

        dbManager = new Dbmanager();
        dbManager.openConnection();
        queryManager = new QueryManager(dbManager);


        int course_id = 0;


        if (request.getParameter("browsecourseid") != null) {
            course_id = Integer.parseInt(request.getParameter("browsecourseid"));
            request.setAttribute("browsecourseid", course_id);
        }

        String address = "/browse_documents.jsp";
        dbManager.closeConnection();
        RequestDispatcher dispatcher = request.getRequestDispatcher(address);
        dispatcher.forward(request, response); //Stuurt door naar de Gebruikers index

    }
}
